package com.yyds.controller;


import com.yyds.common.MyJSON;
import com.yyds.common.R;
import com.yyds.pojo.VirusVirus;
import com.yyds.service.VirusVirusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/admin/virus/virus")
@SuppressWarnings({"all"})//抑制警告
public class VirusVirusController {

    @Autowired
    VirusVirusService virusVirusService;

    @RequestMapping("list")
    public MyJSON<VirusVirus> list(@RequestParam Map<String,Object> map){
        return  virusVirusService.selectAllVirusVirusService(map);
    }
    @RequestMapping("/add")
    public R add(@RequestParam Map<String ,Object> map){
        return virusVirusService.insertVirusVirusService(map);
    }
    @RequestMapping("/del")
    public R del(@RequestParam Map<String ,Object> map){
        return virusVirusService.deleteVirusVirusService(map);
    }

    @RequestMapping("/delAll")
    public R delAll(@RequestBody List<VirusVirus> list){
        System.out.println("进入删除多条评论 list="+list);
        return virusVirusService.deleteAllVirusVirusService(list);
    }

    @RequestMapping("/query")
    public R query(@RequestParam Map<String ,Object> map){
        return virusVirusService.selectVirusVirusService(map);
    }
    @RequestMapping("/edit")
    public R edit(@RequestParam Map<String ,Object> map){
        return virusVirusService.updateVirusVirusService(map);
    }


    @RequestMapping("/typePie")
    public R typePie(){
        return virusVirusService.queryTypeVirusVirusService();
    }
}
